<template>
	<view>
		<view style="height:92upx;position:fixed;top:0;background-color:#FFFFFF;width:750upx;z-index:99;">
			<view @click="backto()" style="position:absolute;width:150upx;height:92upx;float:left;line-height:92upx;">
				<text class="iconfont" style="color:#666666;font-size:48upx;">&#xe617;</text>
			</view>
			<view style="text-align:center;height:92upx;line-height:92upx;color:#000000;font-size:34upx;font-weight:700;">分销积分</view>
			<view @click="rules()" style="width:150upx;height:92upx;float:right;margin-top:-92upx;line-height:92upx;">
				<text class="iconfont" style="color:#999999;font-size:24upx;">&#xe6eb;提现规则</text>
			</view>
		</view>
		<view style="width:750upx;height:92upx;"></view>
		<view class="scores">
			<view class="score_first">我的积分金额</view>
			<view class="score_second">{{myScores.score}}</view>
			<view class="score_third">
				<view class="score_button" @tap="details()">
					提现明细
				</view>
			</view>
		</view>
		<view class="score_lists">
			<view class="score_list">
				<view>可提积分</view>
				<view>{{myScores.score}}</view>
			</view>
			<view class="score_list">
				<view>已提积分</view>
				<view>{{myScores.withdrawed_money}}</view>
			</view>
			<view class="score_list">
				<view>在提积分</view>
				<view>{{myScores.withdrawing_money}}</view>
			</view>
			<!-- <view class="score_list">
				<view>待打款金额</view>
				<view>{{myScores.withdrawing_money}}</view>
			</view> -->
			<!-- <view class="score_list">
				<view>已提金额</view>
				<view>{{myScores.withdrawed_money}}</view>
			</view> -->
		</view>
		<view class="withdraw" @tap="withdraw()">
			<view>我要提现</view>
		</view>
	</view>
</template>

<script>
	import request from '@/common/lib/request.js'
	export default {
		data() {
			return {
				myScores:''
			}
		},
		onLoad:function(){
			
			uni.setNavigationBarTitle({
				title: '分销积分'
			});
			uni.request({
				url: request.common.baseUrl+'/api/distributor/myScore',
				data: {
					token:uni.getStorageSync('keyToken')
				},
				header: {
					'Content-Type':'application/json;charset=UTF-8',
					'Content-Type':'application/x-www-form-urlencoded'
				},
				success: (res) => {
					console.log(res)
					if(res.data.code==200){
						this.myScores=res.data.data
					}
				}
			});
		},
		methods:{
			details: function (){
				uni.navigateTo({
					url:'/pages/distribution/withdrawdetail'
				})
			},
			backto(){
				uni.navigateBack({
					delta:1
				})
			},
			withdraw(){
				uni.navigateTo({
					url:"/pages/distribution/withdraw?score="+this.myScores.score
				})
			},
			rules(){
				uni.navigateTo({
					url:"/pages/distribution/rules"
				})
			}
		}
	}
</script>

<style>
	
	@font-face {
	  font-family: 'iconfont';
	  src: url('@/static/font/iconfont.eot');
	  src: url('@/static/font/iconfont.eot?#iefix') format('embedded-opentype'),
		  url('@/static/font/iconfont.woff2') format('woff2'),
		  url('@/static/font/iconfont.woff') format('woff'),
		  url('@/static/font/iconfont.ttf') format('truetype'),
		  url('@/static/font/iconfont.svg#iconfont') format('svg');
	}
	.iconfont {
	  font-family: "iconfont" !important;
	  font-size: 34upx;
	  font-style: normal;
	  -webkit-font-smoothing: antialiased;
	  -moz-osx-font-smoothing: grayscale;
	}
page{
	background-color:#fafafa;
}
.scores{
	background-image: linear-gradient(60deg,#1366ea,#3780f3,#488cf8);
	width:750upx;
	height:280upx;
	text-align:center;
	color:#FFFFFF;
}
.score_first{
	font-size:26upx;
	padding-top:36upx;
}
.score_second{
	font-size:46upx;
}
.score_third{
	margin:10upx 310upx 0upx 310upx;
	text-align: center;
}
.score_button{
	width:100upx;
	font-size:24upx;
	border:1upx solid #FFFFFF;
	border-radius:25upx;
	height:40upx;
	line-height:40upx;
	padding:5upx 15upx;
}
.score_lists{
	background-color:#FFFFFF;
}
.score_list{
	width:750upx;
	height:80upx;
	border-bottom:1upx solid #f6f6f6;
	padding-top:10upx;
	padding-bottom:10upx;
}
.score_list view:nth-child(1){
	float:left;
	font-size:26upx;
	margin-left:50upx;
	height:80upx;
	line-height:80upx;
}
.score_list view:nth-child(2){
	float:right;
	font-size:26upx;
	margin-right:50upx;
	height:80upx;
	line-height:80upx;
}
.withdraw{
	margin-top:250upx;
	text-align:center;
}
.withdraw view{
	background-color:#ff6101;
	color:#FFFFFF;
	font-size:28upx;
	width:650upx;
	height:80upx;
	line-height:80upx;
	margin:auto;
	border-radius:30upx;
}
</style>
